package com.ajk.server.dao;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.ajk.server.dao.provider.TestQuestionItemProvider;
import com.ajk.server.model.TestQuestionItem;
import com.ajk.server.model.query.TestQuestionItemQuery;
/**
 * 测试题目选项  <br>
 * t_test_question_item <br>
 * v1.0 2016-05-01
 */
 public interface TestQuestionItemMapper {
 	
 	/**
 	*根据id删除 测试题目选项
 	*/
 	@Delete("delete from t_test_question_item where id=#{id}")
 	public Integer deleteById(Integer id);
 	
 	/**
 	* 批量新增 测试题目选项
 	*/
 	@InsertProvider(method="batchInsert",type=TestQuestionItemProvider.class)
	@Options(useGeneratedKeys=true,keyColumn="id",keyProperty="list[0].id")
 	public Integer batchInsert(List<? extends TestQuestionItem> testQuestionItems);
 	
 	/**
 	* 新增 测试题目选项
 	*/
 	@InsertProvider(method="insert",type=TestQuestionItemProvider.class)
	@Options(useGeneratedKeys=true)
 	public Integer insert(TestQuestionItem domain);
 
 	
 	/**
 	*更新 测试题目选项
 	*/
 	@UpdateProvider(method="update",type=TestQuestionItemProvider.class)
 	public Integer update(TestQuestionItem domain);
 	
 	/**
 	*根据ID查询 测试题目选项
 	*/
	@Select("select * from t_test_question_item where id=#{id}")
	public TestQuestionItem findById(Integer id);
	
	/**
 	*通过query 查询 测试题目选项
 	*/
 	@SelectProvider(method="findByQuery",type=TestQuestionItemProvider.class)
 	public List<TestQuestionItem> findByQuery(TestQuestionItemQuery query);
 	
 	/**
 	*通过query count总条数
 	*/
 	@SelectProvider(method="countByQuery",type=TestQuestionItemProvider.class)
 	public Integer countByQuery(TestQuestionItemQuery query);
 	
 	/**
 	* 通过ids查询
 	*/
 	@SelectProvider(method="findByIds",type=TestQuestionItemProvider.class)
 	public List<TestQuestionItem> findByIds(List<Integer> ids);
 	
 	/**
 	 * 通过问题Ids查询选项
 	 * @param questionIds
 	 * @return
 	 */
 	@SelectProvider(method="findByQuestionIds",type=TestQuestionItemProvider.class)
 	public List<TestQuestionItem> findByQuestionIds(List<Integer> questionIds);
 	

}	